package com.study.guide.pack;

import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelPipeline;
import io.netty.channel.socket.SocketChannel;

public class TimeClientInitializer extends ChannelInitializer<SocketChannel> {

	@Override
	protected void initChannel(SocketChannel ch) throws Exception {
		ChannelPipeline pl = ch.pipeline(); //连接所有处理器
		pl
//			.addLast(new LengthFieldBasedFrameDecoder(Integer.MAX_VALUE, 0,4,0,4))
//			.addLast(new LengthFieldPrepender(4))
//			.addLast(new StringDecoder(CharsetUtil.UTF_8))
//			.addLast(new StringEncoder(CharsetUtil.UTF_8))
			.addLast(new TimeClientHandler());
	}

}
